// 定义全局变量
var userId=parseInt(Math.random()*100000000);
var randPosition={
    'x':parseInt(Math.random()*300+100),
    'y':parseInt(Math.random()*300+100)
}
var count=10;
var userName=userId;
var person=new Array();
var websocket = null;
var bLeft=false;
var bTop=false;
var bRight=false;
var bBottom=false;
function getMousePosition(event) {
    var e = event || window.event;
    var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
    var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
    var x = e.pageX || e.clientX + scrollX;
    var y = e.pageY || e.clientY + scrollY;
    return { 'x': x, 'y': y };
}
function cirHitTest(x1,y1,r1,x2,y2,r2){
    if((r1+r2)>Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))){
        return true;
    }
    return false;
}
window.onload=function (ev){
    document.getElementsByTagName("body")[0].style.height = document.body.scrollHeight+"px";
    document.getElementsByTagName("body")[0].style.width  = document.body.scrollWidth+"px";
}